import { useEffect, useState } from 'react'
import { itemList, getInfo } from '@/apis/home'

const useTabs = () => {

  const [channels, setChannels] = useState<itemList[]>([])
  useEffect(() => {
    const getIChannels = async () => {
      try {
        const res = await getInfo()
        setChannels(res.data.data)
        console.log('接口数据', res)
      } catch {
        throw new Error('err')
      }
    }
    getIChannels()
  }, [])
  return { channels }
}

export { useTabs }